extends BaseStateMachine
class_name GameStateMachine

## 游戏流程状态机：负责管理整个游戏的流程。使用状态机管理游戏流程能使整个流程更清晰

## 游戏流程状态枚举
enum GAME_STATE_TYPE{
	INIT, ## 初始化状态
	READY, ## 准备状态，显示菜单
	PLAYING, ## 游戏进行中状态
	PAUSE, ## 游戏暂停状态
	END ## 游戏结束状态
}

## 初始化操作
class InitState:
	extends BaseState
	func enter(_msg:Dictionary={}):
		print("enter init state")
		agent.init_game()
		transition_to(GAME_STATE_TYPE.READY)

class ReadyState:
	extends BaseState
	func enter(_msg:Dictionary = {}):
		print("enter ready state")
		agent.ready_game()
		
class PlayingState:
	extends BaseState


class PauseState:
	extends BaseState
	
class EndState:
	extends BaseState
	
	
func _ready():
	add_state(GAME_STATE_TYPE.INIT,InitState.new(self))
	add_state(GAME_STATE_TYPE.READY,ReadyState.new(self))
	add_state(GAME_STATE_TYPE.PLAYING,PlayingState.new(self))
	add_state(GAME_STATE_TYPE.PAUSE,PauseState.new(self))
	add_state(GAME_STATE_TYPE.END,EndState.new(self))
	
